iis nameid

*Table 2
tab withdonorsdist if distN>39
tab withdonorspart if partisanN>39

* Table 3
* Random Effects [1]
xtlogit libvote libntdnpty distmedian demrep aff ydum1-ydum5 if distN>39, re
margins, dydx(libntdnpty) atmeans
margins, dydx(distmedian) atmeans
* House Donors [2]
xtlogit libvote libhousedonor distmedian demrep aff ydum1-ydum5 if distN>39, re
margins, dydx(libhousedonor) atmeans
* Fixed effects [3]
xtlogit libvote libntdnpty distmedian demrep aff ydum1-ydum5 if distN>39, fe
* District partisans [4]
xtlogit libvote libntdnpty distmedian demrep aff distpartisan ydum1-ydum5 if partisanN>39 & abspartisan>.15, re
* In-District Donors, CCES [5]
xtlogit libvote libntdnpty libdistdonor distmedian demrep aff if distN>39 & distdonorN>39, re
* In-district CF Scores [6]
xtlogit libvote libntdnpty libdistdonorcf distmedian demrep aff ydum1-ydum5 if distN>39, re

* Table 4 
* Electoral favorability (Cook PVI) [1]
xtlogit libvote cookfavlibntdn libntdn cookfav cookfavdist distmedian aff demrep ydum1-ydum5 if distN>39, re
xtlogit libvote c.cookfav##c.libntdnpty c.cookfav##c.distmedian aff demrep ydum1-ydum5 if distN>39, re
margins, dydx(libntdnpty) at(cookfav=(0 20)) atmeans
* Redistricting, district safety (Cook PVI) [2]
xtlogit libvote cookfavlibntdn libntdnpty cookfav cookfavdist distmedian aff ydum1-ydum5 if (year==2010 | year==2012) & distN>39, fe

* Table 5
* pct out-district
* Random effects logit [1]
xtlogit libvote libntdnpty lagood100libntdn lagood100 distmedian aff demrep ydum1-ydum5 if distN>39, re
*margins, dydx(lagood100libntdn) atmeans
xtlogit libvote c.lagood100##c.libntdnpty distmedian aff demrep ydum1-ydum5 if distN>39, re
margins, dydx(libntdnpty) at(lagood100=(.1 .9)) atmeans
* 2SLS [2]
* show 2nd-stage in main text and 1st-stage equations in appendix
xtivreg  libvote libntdnpty distmedian aff demrep ydum1-ydum5 (lagood100libntdn lagood100 = distmedian aff ydum1-ydum5 libntdnpty lagchair lagchairlibntdn demrep) if distN>39, first 
*Hausman test 
*Just for reporting Hausman test --in Table 5 in column above N
xtivreg  libvote libntdnpty distmedian aff demrep ydum1-ydum5 (lagoodlibntdn lagood100 = distmedian aff ydum1-ydum5 libntdnpty lagchair lagchairlibntdn demrep) if distN>39, first
estimates store iv
 xtreg  libvote distmedian aff demrep ydum1-ydum5 libntdnpty lagood100 lagoodlibntdn if distN>39, re
hausman iv
* District safety [3]
xtlogit libvote libntdnpty lagood100libntdn lagood100 cookfavlibntdn cookfav cookfavdist distmedian aff demrep ydum1-ydum5 if distN>39, re


*** Supplemental Appendix ***

* S3. Yea Vote
xtlogit yeavote yeantdnpty partyposyea yeadistmedian yeaaff ydum1-ydum5 if distN>39, re

* S4. Alternative Specifications 
* No controls [1]
xtlogit libvote libntdnpty if distN>39, re
* Basic logit [2]
logit libvote libntdnpty distmedian demrep aff ydum1-ydum5 if distN>39, cluster(nameid)
* 100 respondent threshold [3]
xtlogit libvote libntdnpty distmedian demrep aff ydum1-ydum5 if distN>99, re
* MRP Model [4]
xtlogit libvote libntdnpty distmedian_mrp demrep aff ydum1-ydum5, re
* Fixed effects, LPM [5]
xtreg libvote libntdnpty distmedian demrep aff ydum1-ydum5 if distN>39, fe
* Validated donors [6]
xtlogit libvote vallibntdnpty distmedian demrep aff ydum1-ydum5 if distN>39, re

* S5. Alternative party specifications
* DW-Nominate [1]
xtlogit libvote libntdnpty distmedian nominate aff ydum1-ydum5 if distN>39, re
* Majority control [2]
xtlogit libvote libntdnpty majlibntdn distmedian aff majority demrep ydum1-ydum5 if distN>39, re
* Democrats [3]
xtlogit libvote libntdnpty distmedian aff ydum1-ydum5 if demrep==1 & distN>39, re
* Republicans [4]
xtlogit libvote libntdnpty distmedian aff ydum1-ydum5 if demrep==0 & distN>39, re

* S6. Subconstituencies, alternative specifications
* District partisan opinion, full sample [1]
xtlogit libvote libntdnpty distmedian demrep aff distpartisan ydum1-ydum5 if partisanN>39, re
* National activists [2]
xtlogit libvote libntdnpty distmedian demrep aff ntlactivist ydum1-ydum5 if distN>39, re 
* District informed opinion [3]
xtlogit libvote libntdnpty distmedian demrep aff informdistmed ydum1-ydum5 if informedN>39, re 
* Size of donations [4]
xtlogit libvote libsmalldonor liblargedonor distmedian demrep aff ydum1-ydum5 if distN>39, re
* Member CF score [5]
xtlogit libvote libntdnpty libcfscore distmedian demrep aff ydum1-ydum5 if distN>39, re

* S7. Party position
xtivreg yeavote (partyposyea = clintonyea demclintonyea demrep) yeantdnpty yeadistmedian yeaaff ydum1-ydum5 if distN>39, first re

* S8. District safety, alternative specifications
* Cook PVI, LPM re [1]
xtreg libvote cookfavlibntdn libntdn cookfav cookfavdist distmedian aff demrep ydum1-ydum5 if distN>39, re
* Cook PVI LPM, redistricting (fe) [2]
xtreg libvote cookfavlibntdn libntdnpty cookfav cookfavdist distmedian aff ydum1-ydum5 if (year==2010 | year==2012) & distN>39, fe
* Presidential vote (re) [3]
xtlogit libvote pv00libntdn libntdnpty pv00 pv00distmed distmedian aff demrep ydum1-ydum5 if  distN>39, re
* Presidential vote, redistricting (fe) [4]
xtlogit libvote pv00libntdn libntdnpty pv00 pv00distmed distmedian aff ydum1-ydum5 if (year==2010 | year==2012) & distN>39, fe            
* Presidential vote LPM re [5]
xtreg libvote pv00libntdn libntdnpty pv00 pv00distmed distmedian aff demrep ydum1-ydum5 if  distN>39, re
* Presidential vote LPM, redistricting (fe) [6]
xtreg libvote pv00libntdn libntdnpty pv00 pv00distmed distmedian aff ydum1-ydum5 if (year==2010 | year==2012) & distN>39, fe 

* S9. Intrumenting for national donor opinion
ivprobit libvote (libntdnpty=lagntldonor clintonlib demrepclintonlib) distmedian demrep aff ydum1-ydum5 if distN>39, first vce(cluster nameid)
*Haumsan test
xtreg yeavote partyposyea yeantdnpty yeadistmedian yeaaff ydum1-ydum5 if distN>39,  re
estimates store iv
xtivreg yeavote (partyposyea = clintonyea demclintonyea demrep) yeantdnpty yeadistmedian yeaaff ydum1-ydum5 if distN>39, first re
hausman iv
*Woolridge test for endogeneity (see his 2010 MIT Press book)
reg partyposyea clintonyea demclintonyea demrep yeantdnpty yeadistmedian yeaaff ydum1-ydum5 if distN>39
predict vhat2, resid
xtreg yeavote vhat2 partyposyea yeantdnpty yeadistmedian yeaaff ydum1-ydum5 if distN>39, re
*insignificance of vhat2 suggests partyposyea is not endogenous

* S10. Marginal effects for Table 4
xtlogit libvote c.cookfav##c.libntdnpty c.cookfav##c.distmedian aff demrep ydum1-ydum5 if distN>39, re
margins, dydx(libntdnpty) at(cookfav=(-5 0 5 10 15 20)) atmeans

* S11. Member wealth 
* Member wealth [1]
xtlogit libvote wealthlibntdn libntdn wealth distmedian aff demrep ydum1-ydum5 if distN>39, re
* Member wealth, top 10% [2]
xtlogit libvote wealth10libntdn libntdn wealth10 distmedian aff demrep ydum1-ydum5 if distN>39, re

* S12. Committee chairs and legislative voting
* Baseline model [1]
xtlogit libvote libntdnpty distmedian demrep aff lagchair lagchairlibntdn ydum1-ydum5 if distN>39, re
* Democrats only [2]
xtlogit libvote libntdnpty distmedian demrep aff lagchair lagchairlibntdn ydum1-ydum5 if distN>39 & demrep==1, re
* Republicans only [3]
xtlogit libvote libntdnpty distmedian demrep aff lagchair lagchairlibntdn ydum1-ydum5 if distN>39 & demrep==0, re

* S13. Marginal effects for Table 5
xtlogit libvote c.lagood100##c.libntdnpty distmedian aff demrep ydum1-ydum5 if distN>39, re
margins, dydx(libntdnpty) at(lagood100=(.1 .3 .5 .7 .9)) atmeans
xtlogit libvote c.lagood100##c.libntdnpty c.cookfav##c.libntdnpty c.cookfav##c.distmedian distmedian aff demrep ydum1-ydum5 if distN>39, re
margins, dydx(libntdnpty) at(cookfav=(0) lagood100=(.1 .3 .5 .7 .9)) atmeans
margins, dydx(libntdnpty) at(cookfav=(20) lagood100=(.1 .3 .5 .7 .9)) atmeans

*S14. Descriptive statistics of variables
sum libvote libntdnpty libhousedonor libdistdonor libdistdonorcf vallibntdnpty libsmalldonor liblargedonor lagntldonor distmedian ///
ntlactivist libcfscore demrep aff cookfav pv00 lagood100 lagchair majority nominate clintonlib libcfscore wealth wealth10 ///
if libvote!=. & distN>39
sum libdistdonor if libvote!=. & distN>39 & distdonorN>39
sum informdistmed if libvote!=. & informedN>39
sum distpartisan if libvote!=. & partisanN>39
sum distmedian_mrp if libvote!=.
sum yeavote partyposyea if yeavote!=. & distN>39
